package com.bio.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

import org.hibernate.Hibernate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.bio.entity.attachemnt.Attachment;
import com.bio.entity.information.Information;

public class AttachmentUtil {

	@SuppressWarnings("deprecation")
	public static List<Attachment> setAttachments(List<Attachment> attachments, Information information) {
		/*for (Attachment attachment : attachments) {
			File file = attachment.getFile();
			try {
				FileInputStream fileInputStream = new FileInputStream(file);
				byte datas[] = new byte[fileInputStream.available()];
				while(fileInputStream.read(datas)!=-1){
					System.out.println(datas);
					fileInputStream.read(datas);
				}
				attachment.setData(Hibernate.createBlob(bytes, Hibernate.));
				attachment.setInformation(information);
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}*/
		return attachments;
	}

}
